/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package xdxn.editor.studio.data.sprite;

import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;

/**
 * 精灵动画类
 *
 * @author Cai Han
 * @creation 2015-7-11
 */
public class Animation {

    /**
     * 动画ID
     */
    public int id;
    /**
     * 动画名称
     */
    public String name;
    /**
     * 帧列表
     */
    public ArrayList<Frame> frame_list;
    /**
     * 动画播放的定时器
     */
    public Timer timer;
    /**
     * 当前帧
     */
    public int current_frame_index;

    public void paint(Graphics g){
        
        
        
    }
    
    /**
     * 用于播放的定时器
     */
    private class Play extends TimerTask {

        @Override
        public void run() {
            if ( current_frame_index++ > frame_list.size() - 1 ) {
                current_frame_index = 0;
            }
        }
    }
}
